﻿/*******************************************************************************
 * AAEngine
 * Copyright (c) 2010 Mike Jarosch
 *
 * Original source PushButton Engine:
 * Copyright (C) 2009 PushButton Labs, LLC
 * For more information see http://www.pushbuttonengine.com
 *
 * This file is licensed under the terms of the MIT license, which is included
 * in the "MIT License.txt" file at the root directory of this SDK.
 ******************************************************************************/

using AAEngine.Engine;
using AAEngine.Rendering2D.Renderers;

namespace AAEngine.Rendering2D
{
    public interface IScene2D
    {
        /// <summary>
        /// Layers are assigned positive integers between 0 and N. This tells 
        /// you what N is. This can be the same as how many layers there are,
        /// but you might only be using layers 2,3, and 7, in which case
        /// LayerCount will be 8, but there will only be three layers. 
        /// </summary>
        /// <remarks>LayerCount is mostly useful in order to iterate over all the
        /// layers by calling GetLayer</remarks>
        int LayerCount { get; }

        /// <summary>
        /// Get the layer at specified index. 
        /// </summary>
        /// <param name="index">Index of the layer to return</param>
        /// <param name="allocateIfAbsent">Fales by default. If true, will allocate
        /// a new layer if none is present.</param>
        /// <returns>The requested layer</returns>
#if WINDOWS_PHONE || XBOX
        ISceneLayer GetLayer(int index);
        ISceneLayer GetLayer(int index, bool allocateIfAbsent);
#else
        ISceneLayer GetLayer(int index, bool allocateIfAbsent = false);
#endif

        void AddRenderable(RendererBase renderable);
        void RemoveRenderable(RendererBase renderable);

        void RenderScene(Box worldExtents, RenderQueue renderQueue);
    }
}
